<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common/jspcommon.jsp"%>

<%@ include file="../common/css.jsp"%>
<%@ include file="../common/js.jsp"%>
<link type="text/css" rel="stylesheet" href="/css/v4/channel.css"/>
<link type="text/css" rel="stylesheet" href="/css/v4/detail.css"/>

<!--[if ie 6]><script src="../../js/v4/iepng.js" type="text/javascript"></script><![endif]-->
<!--[if ie]><link href="../../css/v4/common/IE.css" type="text/css" rel="stylesheet"><![endif]-->

<script type="text/javascript">
	
	$(function(){
		$(".y_h_k").hide();
		$("#tixian_box").find(":radio:first").click(function(){
			$(".y_h_k").hide();
			$(".z_f_b").show();
		});
		$("#tixian_box").find(":radio:last").click(function(){
			$(".y_h_k").show();
			$(".z_f_b").hide();
		});
		$.fn.popDiv({tcID : "tixian_box", opacity : 0.4, isZZ : true, speed : 0, noResize : true });
		
	});
	
	//保存 会员提现申请
	function saveTianApply(self){
		var drawType = $("#tixian_box").find(":radio:first").attr("checked")=="checked"?"01":"02";
		var alipay = $("#alipay").val();
		var bankNum = $("#bankNum").val();
		var bankName = $("#bankName").val();
		var realname = $("#realname").val();
		if(drawType=="01" && (alipay=="" || realname=="")){
			alert("请填写完整");
			return;
		}else if(drawType=="02" && (bankNum=="" || bankName=="" || realname=="")){
			alert("请填写完整");
			return;
		}
		$(self).attr("onclick","");
		$.post("/account/savetianapply.htm",{
			drawType : drawType,
			alipay : alipay,
			bankNum : bankNum,
			bankName : bankName,
			realname : realname
		},function(data){
			if(data == "success"){
				$("#wytxb").attr("onclick","");
				$("#wytxb").attr("class","def_btn_s9 disabled");
				$("#tx_result").html($("#tx_success").html());
			}else{
				alert("系统有点抽经，请稍候重试！");
			}
		});
	}
	
</script>

    <div class="tc_box release_box tx_box" id="tixian_box">
    	<div class="release_title tx_title">
        	<a href="javascript:void(0);" class="tc_close close_btn">关闭</a>
            <p>您可以申请提现：<fmt:formatNumber value="${account.rmb-account.rmb%50 }" pattern="#" />元</p>
        </div>
        <div class="content clearfix">
			<div class="tx_pd_s2" id="tx_result">
            	<div class="tx_box_s1">
                	<div class="tx_sorts">
                    	<input type="radio" name="tc_sorts" checked="checked" /> <span class="mr20" onclick="$(this).prev().click()" style="cursor: pointer;">使用支付宝收款(免手续费)</span>
                        <input type="radio" name="tc_sorts" /> <span onclick="$(this).prev().click()" style="cursor: pointer;">使用银行卡收款</span>
                    </div>
                    <div class="tx_form">
                    	<table>
                        	<tr class="z_f_b">
                        		<td><span class="lbl">支付宝用户名：</span></td><td><input type="text" id="alipay" class="def_text_3" value="" /></td>
                            </tr>
                            <tr class="y_h_k">
                        		<td><span class="lbl">银行卡账号：</span></td><td><input type="text" id="bankNum" class="def_text_3" value="" /></td>
                            </tr>
                            <tr class="y_h_k">
                        		<td><span class="lbl">开户行名称：</span></td><td><input type="text" id="bankName" class="def_text_3" value="" /></td>
                            </tr>
                            <tr>
                        		<td><span class="lbl">真实姓名：</span></td><td><input type="text" id="realname" class="def_text_3" value="" /></td>
                            </tr>
                            <tr>
                            	<td width="103"></td>
                                <td>
                                	<div class=" apply_sub">
                                		<input type="submit" class="def_btn_s2"  value="申请提现" onclick="saveTianApply(this)"/><a class="tx_tip">>> 转账手续费、大额收入缴税等问题</a>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
<div class="tx_box_s2" id="tx_success" style="display: none;">
	<div class="tx_apply_sucuss">
    	<span>申请提交成功，我们会在2-3个工作日内为您转账。</span><br>
        <input type="submit" class="def_btn_s2 tc_close" value="确定">
    </div>
</div>